<?php declare(strict_types=1);


namespace App\Model\Dao;


use App\Model\Entity\User;
use Swoft\Bean\Annotation\Mapping\Bean;

/**
 * @Bean(name="HttpUserDao")
 * Class UserDao
 * @package App\Model\Dao
 * @author 张伯发 2019/7/31 15:09
 */
class UserDao
{

    /**
     * @param $id
     * @return array
     * @throws \Swoft\Db\Exception\DbException
     * @author 张伯发 2019/7/31 15:13
     */
    public function getUser($id) : array
    {
        $user = User::find($id);
        return $user->toArray();
    }

}
